$(function(){
	var c=0;
	$(".list").click(function(){
		if(c==0){
			$("#nav_hid").slideDown(500);
			c=1;
		}else{
			$("#nav_hid").slideUp(500);
			c=0;
		}
		
	});
	var num=0;
	var num1=0;
//	函数
	function run(){
		num++;
		if(num==3){num=0;}
		$("#box img").eq(num).fadeIn(500).siblings('img').fadeOut(500);
		$("#ul li").eq(num).css({background:"#0097D6"}).siblings('li').css({background:"white"});
	}
	timer=setInterval(run,2000);
	function run1(){
		num1++;
		if(num1==4){num1=0;}
		$("#small img").eq(num1).fadeIn(500).siblings('img').fadeOut(500);
	}
	timer1=setInterval(run1,2000);
//	鼠标移入移出
	$("#box").mousemove(function() {
		clearInterval(timer);
	});
	$("#box").mouseout(function() {
		timer=setInterval(run,2000);
	});
	$("#small").mouseover(function() {
		clearInterval(timer1);
		$("#small img").eq(num1).animate({width:"110%",height:"110%",left:"-5%",top:"-5%"},700).siblings().css({width:"100%",height:"100%",left:"0px",top:"0px"});
	});
	$("#small").mouseout(function() {
		timer1=setInterval(run1,2000);
	});
	$("#ul li").mousemove(function() {
		var t=$(this).index();
		$("#box img").eq(t).fadeIn(500).siblings('img').stop().fadeOut(500);
		$("#ul li").eq(t).css({background:"#0097D6"}).siblings('li').css({background: 'white'});
	});
});
